/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.letmeshare.pedagogue.core.module;

import javax.persistence.EntityManager;

/**
 *
 * @author ibisuser1
 */
public abstract class AbstractModule {
    protected static void checkEntityManager(EntityManager em) {
        if (em == null) {
            throw new IllegalArgumentException("EntityManager required");
        }
    }
    /**
     * Check  Object is null, is null it will  throw {@IllegalArgumentException(msg)}
     * @param object check is null
     * @param msg 
     * @exception  IllegalArgumentException
     */
    protected static void isNull(Object object,String msg) {
        if (object == null) {
            throw new IllegalArgumentException(msg);
        }
    }
    /**
     * Check  Object is null, is null it will  throw {@IllegalArgumentException(msg)}
     * @param object check is null
     * @exception  IllegalArgumentException with default message
     */
    protected static void isNull(Object object) {
        isNull(object, "Argument may not be null");
    }
}
